package vn.appsmobi.model;

import java.util.ArrayList;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class HomeInfo
{
    private String mHomeId;
    private String mHomeName;
//    private ImageView mCategoryPhoto;
    private long mTotalCount;
    
    public HomeInfo(String homeid, String categoryname/*, ImageView categoryphoto*/, long hometotal)
    {
        this.mHomeId = homeid;
        this.mHomeName = categoryname;
        //this.mCategoryPhoto = categoryphoto;
        this.mTotalCount = hometotal;
    }
    
    public static ArrayList<HomeInfo> valueOf(JSONObject paramJSONObject) throws JSONException
    {
        ArrayList<HomeInfo> homeArray =  new ArrayList<HomeInfo>();
        
        /*JSONArray localJSONArray = paramJSONObject.getJSONObject("data").getJSONArray("categroies");
        if (localJSONArray != null)
        {
            categoryArray = new ArrayList<CategoryInfo>();
            for (int i = 0; i < localJSONArray.length(); i++)
            if (!localJSONArray.isNull(i))
            {
                JSONObject localJSONObject = localJSONArray.getJSONObject(i);
                String str1 = localJSONObject.getString("cate_id");
                String str2 = localJSONObject.getString("cate_name");
                long l = localJSONObject.getLong("total_count");
                categoryArray.add(new CategoryInfo(str1, str2
                , new Image(localJSONObject.getString("image_url")), l));
            }
        }*/
        homeArray.add(new HomeInfo("1","danh mục 1",10));
        homeArray.add(new HomeInfo("2","danh mục 2",10));
        homeArray.add(new HomeInfo("3","danh mục 3",10));
        homeArray.add(new HomeInfo("3","danh mục 3",10));
        homeArray.add(new HomeInfo("3","danh mục 3",10));
        homeArray.add(new HomeInfo("3","danh mục 3",10));
        homeArray.add(new HomeInfo("3","danh mục 3",10));
        homeArray.add(new HomeInfo("3","danh mục 3",10));
        homeArray.add(new HomeInfo("3","danh mục 3",10));
        homeArray.add(new HomeInfo("3","danh mục 3",10));
        homeArray.add(new HomeInfo("3","danh mục 3",10));
        homeArray.add(new HomeInfo("3","danh mục 3",10));
        homeArray.add(new HomeInfo("3","danh mục 3",10));
        homeArray.add(new HomeInfo("3","danh mục 3",10));
        homeArray.add(new HomeInfo("3","danh mục 3",10));
        homeArray.add(new HomeInfo("3","danh mục 3",10));
        homeArray.add(new HomeInfo("3","danh mục 3",10));
        homeArray.add(new HomeInfo("3","danh mục 3",10));
        homeArray.add(new HomeInfo("3","danh mục 3",10));
        homeArray.add(new HomeInfo("3","danh mục 3",10));
        homeArray.add(new HomeInfo("3","danh mục 3",10));
        return homeArray;
    }
    
    public String getHomeId()
    {
        return this.mHomeId;
    }
    
    public String getName()
    {
        return this.mHomeName;
    }
    
    /* public Image getPhoto()
    {
        return this.mCategoryPhoto;
    }
    */
    public long getTotalCount()
    {
        return this.mTotalCount;
    }
}